package com.rawchen.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.fasterxml.jackson.annotation.JsonInclude;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.Date;

/**
 * @Description: 访问日志
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
@JsonInclude(JsonInclude.Include.NON_NULL)
public class VisitLog {
	@TableId(type = IdType.AUTO)
	private Long id;
	/** 访客标识码 */
	private String uuid;
	/** 请求接口 */
	private String uri;
	/** 请求方式 */
	private String method;
	/** 请求参数 */
	private String param;
	/** 访问行为 */
	private String behavior;
	/** 访问内容 */
	private String content;
	/** 备注 */
	private String remark;
	/** ip */
	private String ip;
	/** ip来源 */
	private String ipSource;
	/** 操作系统 */
	private String os;
	/** 浏览器 */
	private String browser;
	/** 请求耗时（毫秒） */
	private Integer times;
	/** 访问时间 */
	private Date createTime;
	private String userAgent;

	public VisitLog(String uuid, String uri, String method, String behavior, String content, String remark, String ip, Integer times, String userAgent) {
		this.uuid = uuid;
		this.uri = uri;
		this.method = method;
		this.behavior = behavior;
		this.content = content;
		this.remark = remark;
		this.ip = ip;
		this.times = times;
		this.createTime = new Date();
		this.userAgent = userAgent;
	}
}
